#include "ShareMemorey.hpp"
#include "Time.hpp"
#include "Fifo.hpp"

/// @brief
/// @return
int main()
{
    shm.GetShm();
    shm.Shmattch();
    fifo.OpenForWrite();
    // char* shmbuffer = (char*)shm.Getaddr();
    // char ch = 'A';
    // while( ch < 'Z')
    // {
    //  shmbuffer[ch - 'A'] = ch;
    //  ch++;
    //  sleep(1);
    // }
    // 获取数据
    struct Data *shmdata = (struct Data *)shm.Getaddr();
    std::string str = "";
    char ch = 'A';
    while (ch <= 'Z')
    {
        str += ch;
        ch++;
        strcpy(shmdata->status, "最新");
        strcpy(shmdata->lasttime, GetCurTime().c_str());
        strcpy(shmdata->image, str.c_str());
        sleep(1);
    }
    fifo.notify();
    shm.Shmdeattch();

    return 0;
}